<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    *{
        padding: 0;
        margin: 0;
    }
    #surprised{
        width: 400px;
        height: 200px;
        font-size: 30px;
        text-align: center;
        line-height: 200px;
        margin: 20px auto;
        color: white;
        background-color: blue;
    }
</style>
<body>
    <div id="surprised">
点击有惊喜！！！
    </div>
    <script>
        var oDiv=document.getElementById('surprised');
        var clickTimer=0;
        oDiv.onclick=function(){
            switch(clickTimer % 4){
                case 1:
                this.style.backgroundColor='green';
                this.innerText='再次点击试试';
                break;
               case 2:
                this.style.backgroundColor='orange';
                this.innerText='哈哈，骗你的';
                break;
                case 3:
                this.style.backgroundColor='red';
                this.innerText='真的没了';
                break;
               case 4:
                this.style.backgroundColor='blue';
                this.innerText='点击有惊喜哟!!!';
                break;

            }
            clickTimer++;
        }
    </script>
</body>
</html>